package com.test.langchain4j.controller;

import com.test.langchain4j.service.FileMcpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 2025/8/8 15:18
 * @modifiedBy:
 * @version: 1.0
 */
@RestController
public class FileSystemMcpController {
  @Autowired private FileMcpService fileMcpService;

  /**
   * File chat flux. http://localhost:9014/mcp/file/chat?question=请列出E盘根目录下的文件夹列表
   *
   * @param question the question
   * @return the flux
   */
  @GetMapping("/mcp/file/chat")
  public Flux<String> fileChat(@RequestParam("question") String question) {
    return fileMcpService.chat(question);
  }
}
